{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "from fastai import *\n",
    "from fastai.vision import *"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## MNIST CNN"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "path = untar_data(URLs.MNIST)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[PosixPath('/home/jhoward/.fastai/data/mnist_png/training'),\n",
       " PosixPath('/home/jhoward/.fastai/data/mnist_png/models'),\n",
       " PosixPath('/home/jhoward/.fastai/data/mnist_png/testing')]"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "path.ls()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "il = ImageItemList.from_folder(path, convert_mode='L')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "PosixPath('/home/jhoward/.fastai/data/mnist_png/training/8/56315.png')"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "il.items[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "defaults.cmap='binary'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "ImageItemList (70000 items)\n",
       "[Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28)]...\n",
       "Path: /home/jhoward/.fastai/data/mnist_png"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "il"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMUAAADDCAYAAAAyYdXtAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAABaZJREFUeJzt3b9LVQEfx3F9iKKfBC0JDS75F0RDNWRESzkUhUNBEP2goqm5grCloGixKWishiAql6YgaAinpqQlgrLIFtOhIZ/teeBzvwfuTb1pvl7jh8P1QLw5eDrH2zs3N9cD/N9//vYJwFIjCgiigCAKCKKAIAoIooCwqss/z3+KsJT0VqMrBQRRQBAFBFFAEAUEUUAQBQRRQBAFBFFAEAUEUUAQBQRRQBAFBFFAEAUEUUAQBQRRQBAFBFFAEAUEUUAQBQRRQBAFhG7/LdkVbXZ2ttxv3rxZ7s+ePSv3r1+/lvvv37/LfXJystw3bNjQsl29erU8dnh4uNw3btxY7ps3by735cCVAoIoIIgCgiggiAKCu09d9OPHj3IfHR0t9+/fv5d7b2/5BTyNmo7/+fNny3b//v3y2P7+/nLfvn17ubv7BP8QUUAQBQRRQBAFBHefFsnU1FTL9uDBg/LY6enpRT2XgYGBcn///n3bnzE4OFjuW7Zs+aNzWspcKSCIAoIoIIgCgigg9M7NzXXz53X1h/1Nb968adn27NnT0Wc0/dsMDQ2V+5UrV8q96fmk6s2+GzdulMfu2rWr3JuelVomyofCXCkgiAKCKCCIAoIoIHj2qYs6vdN37ty5cr93795CnE7PiRMnWrZ9+/aVx46MjJT7ly9fyr2vr+/PT+wvc6WAIAoIooAgCgiigODZp0XSybNPhw4dKvenT58u6Dmlz58/t2zV34Lq6Wm+m9T0V8eXCc8+QTtEAUEUEEQBwWMeS0DTy0EL5fnz5+V+6dKllm1mZ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giigCAKCKKAIAoI/wUlWxGM2XKZ3wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 216x216 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "il[0].show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "sd = il.split_by_folder(train='training', valid='testing')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "ItemLists;\n",
       "Train: ImageItemList (60000 items)\n",
       "[Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28)]...\n",
       "Path: /home/jhoward/.fastai/data/mnist_png;\n",
       "Valid: ImageItemList (10000 items)\n",
       "[Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28)]...\n",
       "Path: /home/jhoward/.fastai/data/mnist_png;\n",
       "Test: None"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[PosixPath('/home/jhoward/.fastai/data/mnist_png/training/8'),\n",
       " PosixPath('/home/jhoward/.fastai/data/mnist_png/training/5'),\n",
       " PosixPath('/home/jhoward/.fastai/data/mnist_png/training/2'),\n",
       " PosixPath('/home/jhoward/.fastai/data/mnist_png/training/3'),\n",
       " PosixPath('/home/jhoward/.fastai/data/mnist_png/training/9'),\n",
       " PosixPath('/home/jhoward/.fastai/data/mnist_png/training/6'),\n",
       " PosixPath('/home/jhoward/.fastai/data/mnist_png/training/1'),\n",
       " PosixPath('/home/jhoward/.fastai/data/mnist_png/training/4'),\n",
       " PosixPath('/home/jhoward/.fastai/data/mnist_png/training/7'),\n",
       " PosixPath('/home/jhoward/.fastai/data/mnist_png/training/0')]"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(path/'training').ls()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ll = sd.label_from_folder()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LabelLists;\n",
       "Train: LabelList\n",
       "y: CategoryList (60000 items)\n",
       "[Category 8, Category 8, Category 8, Category 8, Category 8]...\n",
       "Path: /home/jhoward/.fastai/data/mnist_png\n",
       "x: ImageItemList (60000 items)\n",
       "[Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28)]...\n",
       "Path: /home/jhoward/.fastai/data/mnist_png;\n",
       "Valid: LabelList\n",
       "y: CategoryList (10000 items)\n",
       "[Category 8, Category 8, Category 8, Category 8, Category 8]...\n",
       "Path: /home/jhoward/.fastai/data/mnist_png\n",
       "x: ImageItemList (10000 items)\n",
       "[Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28), Image (1, 28, 28)]...\n",
       "Path: /home/jhoward/.fastai/data/mnist_png;\n",
       "Test: None"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ll"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "x,y = ll.train[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "8 torch.Size([1, 28, 28])\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMUAAADDCAYAAAAyYdXtAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cG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BAFBFFAEAUEd58WycTExN8+hf8ZGBgo98uXL7dsK+kuUxNXCgiigCAKCKKAIAoI7j7N0/Xr18v91q1bXT6T5rtML1++LPdt27Yt5uksW64UEEQBQRQQRAFBFBDcfWrT9PR0uV+7dq3cO30LrtL05l2T4eHhcl+ov2q+UrhSQBAFBFFAEAWE3k5/mZunrv6whdT0JerVizo9PZ39on327Nly37lzZ7nfvXu33N+9e1fuHz9+LHePefSU/0iuFBBEAUEUEEQBQRQQPObRRefPny/327dvl/vq1avLfffu3eV+6tSpcj98+HC5v337ttxXOlcKCKKAIAoIooAgCgiefWrTq1evyn1wcLDcd+zY0bK9fv26PLbpLlOnZmdny73pT99UL0idOXNmQc5lmfDsE7RDFBBEAUEUEEQBwd2nedq7d2+5z8zMtGxPnjwpj+3r6yv3VasW5tG08fHxch8aGmrZPnz4UB67bt26BTmXJcbdJ2iHKCCIAoIoIIgCgjfv5unIkSPlPjIy0rL19/eXxx48eLDcDxw4UO5Nd7ya7iT++vWr3CcnJ1u2sbGx8tijR4+W+7/IlQKCKCCIAoIoIIgCgmefFkn1pt6xY8fKY6empsq96d9m06ZNHZ1L01eTVZ//+PHj8th/9O6TZ5+gHaKAIAoIooAgCgjuPnXRt2/fyn10dLTcm+4aNT2fNDEx0dH5VM9cPXr0qDx27dq1HX32MuHuE7RDFBBEAUEUEPyizUrmF21ohyggiAKCKCCIAoIoIIgCgiggiAKCKCCIAoIoIIgCgiggiAKCKCCIAkK3v96rfNMJlhJXCgiigCAKCKKAIAoIooAgCgiigCAKCKKAIAoIooAgCgiigCAKCKKAIAoIooAgCgiigCAKCKKAIAoI/wUlWxGM2XKZ3wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 216x216 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "x.show()\n",
    "print(y,x.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "tfms = ([*rand_pad(padding=3, size=28, mode='zeros')], [])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ll = ll.transform(tfms)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAd0AAAHTCAYAAABiN8IeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAHJBJREFUeJzt3T+IlVf6B/Bzw8qyM9pMIE7EIo1MYzcIKYR0BmYCG2ymFGQCmykiEtRiB8ExTSBYRIJgYmFh4R8UJFqI5A/JNEKElJpCi8DYCCHDGBDJ/RXLsr/3nIPzenPnmTv3fj7dczhz38F9dr55Oc993063200AwMZ7bbN/AQAYFUIXAIIIXQAIInQBIIjQBYAgQhcAgghdAAjyt8iLdTodXwoeYd1ut7MZ19V3o20z+k7PjbaX9Zw7XQAIInQBIIjQBYAgQhcAgghdAAgidAEgiNAFgCBCFwCCCF0ACCJ0ASCI0AWAIEIXAIIIXQAIEvqWIaB3Y2Njxdrx48cb9XvvvVfs2blzZ7H22mvN/96enJws9qytrTXqpaWlYs/ly5cb9erqarHnt99+K9ZgVLnTBYAgQhcAgghdAAjiTBe2iImJiWJtYWGhUb/++uvFnm63u+5n1/aMj4836sOHDxd7Hj9+3Kh/+eWXYo8zXfgfd7oAEEToAkAQoQsAQYQuAAQxSAUDKh+KOnToULFn+/btfbnWw4cPi7WpqalG3el0ij3ffvtto3769Glffh8YVu50ASCI0AWAIEIXAIJ02nxxvm8X63TiLsbA6Xa75aFggK3ad2+//Xaj/vHHH9f9mdq569dff12snT59ulHXHmqRvzxhcXGx2LO8vNyo5+fn1/0do21G323VnqM/XtZz7nQBIIjQB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Sal//dJLr6SkX+jd999/X6z98MMPjbo2KLhz585iLR8WbDMoWBvwe//99xt1bVDw0qVLrT5rM7jTBYAgQhcAgghdAAgidAEgiCdS9aD2lJarV6826omJiWJPp1M+pGR1dXXd623fvn3dz5mbm2vUgzgYMwpPpKrpV7/00iu1z0lpa/RLv3giVX999NFHjbo2KFjr53xYsNfB0rzH8zcTpVT2d0qxPe6JVAAwAIQuAAQRugAQxJlun7zxxhuNemFhodhTO2+bnZ1t1PnbX2pqD1LIzzD++OOPdT8n2qie6db00i95r6Q03P3SL850N1abmYWUynPeyBmXlJzpAsDIEboAEEToAkAQoQsAQQxSEcYgFZvBIFW8fFAwpXJYMHKwNKXYYUGDVAAwAIQuAAQRugAQxJkuYZzpshmc6RLNmS4ADAChCwBBhC4ABBG6ABBE6AJAEKELAEGELgAEEboAEEToAkAQoQsAQYQuAAQRugAQROgCQJDQtwwBwChzpwsAQYQuAAQRugAQROgCQBChCwBBhC4ABBG6ABBE6AJAEKELAEGELgAEEboAEEToAkAQoQsAQYQuAAQRugAQROgCQBChCwBBhC4ABBG6ABBE6AJAEKELAEGELgAEEboAEEToAkAQoQsAQf4WebFOp9ONvB6DpdvtdjbjuvputG1G3+m50faynnOnCwBBhC4ABBG6ABBE6AJAEKELAEGELgAEEboAEEToAkAQoQsAQYQuAAQRugAQROgCQBChCwBBQt8yBMBgGBsbK9aOHz/eqN97771iz86dOxv1a6+V926Tk5PF2traWqNeWloq9ly+fLlRr66uFnt+++23Ym0rcacLAEGELgAEEboAEMSZLsAImpiYKNYWFhYa9euvv17s6Xa76352bc/4+HijPnz4cLHn8ePHjfqXX34p9jjTBQBaEboAEEToAkAQoQsAQQxSZXxhnAh5n+U9llLZZ3mPpVT2WZseS6nss7zHUir7TI9tbflQ1KFDh4o927dv78u1Hj58WKxNTU016k6nU+z59ttvG/XTp0/78vsMEne6ABBE6AJAEKELAEE6bb7o3LeLdTpxF+vR7t27i7X79+836l6/MF6Tn2s8ePCg2HPy5MlGXfvC+M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AEKELAEGELgAEEboAEEToAkAQoQsAQYQuAAQRugAQROgCQBChCwBBhC4ABAl9yxAAjDJ3ugAQROgCQBChCwBBhC4ABBG6ABBE6AJAEKELAEGELgAEEboAEEToAkAQoQsAQYQuAAQRugAQROgCQBChCwBBhC4ABBG6ABBE6AJAEKELAEGELgAEEboAEEToAkAQoQsAQf4PIaYYoYYMV8oAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 576x576 with 9 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "def _plot(i,j,ax): data.train_ds[0][0].show(ax, cmap='gray')\n",
    "plot_multi(_plot, 3, 3, figsize=(8,8))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "bs = 128"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# not using imagenet_stats because not using pretrained model\n",
    "data = ll.databunch(bs=bs).normalize()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "x,y = data.train_ds[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "8\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMUAAADDCAYAAAAyYdXtAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAABaJJREFUeJzt3c+LTQ0cx/GZJ5GfKRtTFrMxf4EssDCSDbMgmgWl5EfIyhqlsaHIZqyUJRZKmI2VUhaalZXJRoohYzNmFhY8u+epz/2eutfMXDPm9Vp+Ot05pXene5x7b++vX796gP/986dP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z3lStXlvvOnTvL/cSJE+V+8ODBcn/9+nW5L3euFBBEAUEUEEQBQRQQPPvUphcvXpT74OBguW/btq1le/nyZXls012mTs3OzpZ70/dBVZ8aPHXq1LycyxLh2SdohyggiAKCKCB4oz1Hu3fvLveZmZmW7dGjR+WxfX195b5ixfw8hTM+Pl7uQ0NDLdu7d+/KY9esWTMv57LIeKMN7RAFBFFAEAUEUUDwIaM5OnToULmPjIy0bP39/eWx+/fvL/d9+/aVe9Mdr6Y7iT9+/Cj3ycnJlm1sbKw89vDhw+X+N3KlgCAKCKKAIAoIooDg2acFUn0o6ciRI+WxU1NT5d70b7Nhw4aOzqXpp8mq13/48GF57F9698mzT9AOUUAQBQRRQBAFBHefuujLly/lPjo6Wu5Nd42ank+amJjo6HyqZ64ePHhQHrt69eqOXnuJcPcJ2iEKCKKAIAoIooDg7hPLmbtP0A5RQBAFBFFAEAUEUUAQBQRRQBAFBFFAEAUEUUAQBQRRQBAFBFFAEAUEUUAQBQRRQBAFBFFAEAUEUUAQBQRRQBAFBFFAEAUEUUAQBQRRQBAFBFFAWNHlv1f+nBIsJq4UEEQBQRQQRAFBFBBEAUEUEEQBQRQQRAFBFBBEAUEUEEQBQRQQRAFBFBBEAUEUEEQBQRQQRAFBFBD+BXqTEYyGXK8rAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 216x216 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "x.show()\n",
    "print(y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(torch.Size([128, 1, 28, 28]), torch.Size([128]))"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "xb,yb = data.one_batch()\n",
    "xb.shape,yb.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "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AAQiEIKAIEopAAQiEIKAIHyctMSAKWzYcMGF8+ePVuS9OSTTxb7tZ988okkaerU0u+r3aFDB0nSQQcd5NoaN24sSerevbtrq1WrVqnfMw70SAEgEIUUAAJle9MS1qmVjHWHKfruu+9c7A8/CwoKkr721VdfdfGBBx6YybQq9PU888wzXfzaa6+V7k28mmJM6f7zi/ueX/7yl67t9ttvd3GbNm1K9Z4ZwjpSAMgEeqTlT4XuwcTh0UcflZTY85w7d66L99tvP0nSunXrXNtNN93k4oEDB2YyvQp9Pf0eZUjvMvR76tSp4+IXX3xRktSsWbNSvXea0SMFgEygkAJAINaRolzyJ4vatm3rYjtMv/baa13bI488IilxreHTTz/t4tatW0uSDjvssMwkm8Pq1q3r4sqVC8tFlSpVXJu9HpLUqVOnMr//okWLJElTpkxxbWvXrpUkff31165t6dKiQ37tJNTy5ctd2/7771/mz04neqQAEIhCCgCBGNqjXBo0aJCL77nnnqTX33nnHRdfdNFFkqShQ4e6tgMOOMDFK1asyESKecFf/WCH9FWrVs3oZ3766aeSpF69erk2f93v1q1bJUmDBw92bXfccUdGcyoJPVIACESPdCf/qZht2wqPuPf/FnzllVdcbG+CN2jQIOl9+vTp4+JDDz007XnmI7/3aV1//fUuvvvuuyVJe+xBvyDdatSokfXPPProoyVJw4YNc209e/Z08csvvyxJGjFihGvzJx8POeSQTKeYhJ88AAhEIQWAQHk5tN+yZYskaeLEia7N3xRhxowZkkoeIrz11ltJbV27dnUxQ/vUXXPNNS5etWqVi9u3by9JatKkiWtjSF+xrF692sXFPaJu16ZWq1at2K+zj5Da9aaStGnTprTnWRb8BAJAoLzpkW7cuNHFl1xyiSRp7Nixrq1mzZoufvzxxyVJ3bp1y1J2+LGrrroq7hSQRv4StGOPPdbFdgd+v8dpt8kraaf9n//85y6uV69eWvJMFT1SAAhEIQWAQDk/tLdDB/8gLTukr127tmubMGGCi5s3b56l7JANL730UlJb06ZNY8gkfz344IMu9g/UK05pD8+bNWuWi/11xX379pWUuIdpptEjBYBAFF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aBdfcMEFWc8JyGfvvPOOi+3v36mnnuraWrVqlRQ3bdo0O8mVAj1SAAhEIQWAQHkztN++fbuLe/ToIUnaeVhaUoyKacCAAS5+/vnnXTxv3rw40kEpfPDBB5ISb7N99tlnkqQWLYrOLpw4caKLx40rPL7pxRdfzEKGpUOPFAACUUgBIFDeDO1969atizsFBNq4caOL586dK0l6//33XZsfjxw5UpLUrVs311apUqVMp4hdWLlypYvbtm0rSfrqq6+Svq5z584unjx5sot/97vfZTC71NAjBYBAedMjfe+991xsj6CuUaOGazvrrLOynhPK7qmnnpIkFRQUuLaZM2dKSlz/e8IJJ7j4xhtvlCR17NjRte23334ZzRO7dtttRUfUF9cTtbZt2+bihx56KKM5haJHCgCBKKQAEChvhvb+ukKrXbt2Lq5evXo200EJli1b5uKbbrrJxdOmTZMkrV271rWdc845kqSnn37atQ0dOtTFffr0kSRt3brVtTG0j8/w4cN3+7p9BPS8887LRjppQY8UAALlfI90+fLlkqQRI0a4NvsUU6dOnWLJCYm+/fZbF9unk6ZOneraZsyYkfQ9p512mov/8pe/SEp8Ou3TTz9N+h47yYjsGzt2rIv9SSSrUaNGLh4/frwkad999818YmlCjxQAAlFIASBQzg/tp0+fLilxvZod4jVv3jyWnFBozZo1kqTTTz/dtdmnlHZl8ODBkqQOHTq4tmOPPTbp63r16uXi++67LyhPhBs2bJiLf/jhBxdXq1ZNknTXXXe5tlq1amUvsTShRwoAgSikABAo54f2kyZNSmr7xS9+IUmqV69ettOBx87eFjec32uvvVxsh/OS1LVrV0nSQQcdtNv3Lu66I/tWr14tSZowYUKxr9v12/66XrtHqT+TX97RIwWAQDnfI7W7afvs5hVspRYvO9FQt25d12Z3R/fXGvpPNtneae3atV2b3ZTkzDPPdG2bN29Oe74oO3s6wffff1/s63YS2L92O3bskCSde+65rm3gwIEu/tnPfpb2PEPRIwWAQBRSAAhksvzYXFY+7K233nJx69atJUmVKxfdxbCPJO6xR7n8e6QincKXlut59913u7hfv34pv89PfvITF1epUsXFixcvliSt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xDPsW7duLUl6+OEDfNiXAAAAz0lEQVSHXZt/YF7Mir2e9EgBIBCFFAACVfihfQ5iKJiibt26udgf2sd85jnXM7cwtAeATKBHWv7Qg8ktXM/cQo8UADKBQgoAgSikABCIQgoAgSikABCIQgoAgSikABAo2+tIASDn0CMFgEAUUgAIRCEFgEAUUgAIRCEFgEAUUgAIRCEFgEAUUgAIRCEFgEAUUgAIRCEFgEAUUgAIRCEFgEAUUgAIRCEFgEAUUgAIRCEFgEAUUgAIRCEFgEAUUgAIRCEFgEAUUgAIRCEFgED/DyGX/SvgqlDNAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 360x360 with 9 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "data.show_batch(rows=3, figsize=(5,5))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Basic CNN with batchnorm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def conv(ni,nf): return nn.Conv2d(ni, nf, kernel_size=3, stride=2, padding=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "model = nn.Sequential(\n",
    "    conv(1, 8), # 14\n",
    "    nn.BatchNorm2d(8),\n",
    "    nn.ReLU(),\n",
    "    conv(8, 16), # 7\n",
    "    nn.BatchNorm2d(16),\n",
    "    nn.ReLU(),\n",
    "    conv(16, 32), # 4\n",
    "    nn.BatchNorm2d(32),\n",
    "    nn.ReLU(),\n",
    "    conv(32, 16), # 2\n",
    "    nn.BatchNorm2d(16),\n",
    "    nn.ReLU(),\n",
    "    conv(16, 10), # 1\n",
    "    nn.BatchNorm2d(10),\n",
    "    Flatten()     # remove (1,1) grid\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "learn = Learner(data, model, loss_func = nn.CrossEntropyLoss(), metrics=accuracy)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "================================================================================\n",
      "Layer (type)               Output Shape         Param #   \n",
      "================================================================================\n",
      "Conv2d                    [128, 8, 14, 14]     80                  \n",
      "________________________________________________________________________________\n",
      "BatchNorm2d               [128, 8, 14, 14]     16                  \n",
      "________________________________________________________________________________\n",
      "ReLU                      [128, 8, 14, 14]     0                   \n",
      "________________________________________________________________________________\n",
      "Conv2d                    [128, 16, 7, 7]      1168                \n",
      "________________________________________________________________________________\n",
      "BatchNorm2d               [128, 16, 7, 7]      32                  \n",
      "________________________________________________________________________________\n",
      "ReLU                      [128, 16, 7, 7]      0                   \n",
      "________________________________________________________________________________\n",
      "Conv2d                    [128, 32, 4, 4]      4640                \n",
      "________________________________________________________________________________\n",
      "BatchNorm2d               [128, 32, 4, 4]      64                  \n",
      "________________________________________________________________________________\n",
      "ReLU                      [128, 32, 4, 4]      0                   \n",
      "________________________________________________________________________________\n",
      "Conv2d                    [128, 16, 2, 2]      4624                \n",
      "________________________________________________________________________________\n",
      "BatchNorm2d               [128, 16, 2, 2]      32                  \n",
      "________________________________________________________________________________\n",
      "ReLU                      [128, 16, 2, 2]      0                   \n",
      "________________________________________________________________________________\n",
      "Conv2d                    [128, 10, 1, 1]      1450                \n",
      "________________________________________________________________________________\n",
      "BatchNorm2d               [128, 10, 1, 1]      20                  \n",
      "________________________________________________________________________________\n",
      "Lambda                    [128, 10]            0                   \n",
      "________________________________________________________________________________\n",
      "Total params:  12126\n"
     ]
    }
   ],
   "source": [
    "learn.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "xb = xb.cuda()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "torch.Size([128, 10])"
      ]
     },
     "execution_count": null,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model(xb).shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "LR Finder is complete, type {learner_name}.recorder.plot() to see the graph.\n"
     ]
    }
   ],
   "source": [
    "learn.lr_find(end_lr=100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAIABJREFUeJzt3Xl8VNXdx/HPbyY72VgSCIEQQRCQnQi4obXWfe/iXrfWUm1dau3ealv71NrHpVXbamtdWvWpFW1x19Z9AQ3Ivq8SCEnYskD2nOePGWKEhASSO3cy+b5fr3kxM/fM3G9CMr+ce+4515xziIiIAAT8DiAiItFDRUFERJqpKIiISDMVBRERaaaiICIizVQURESkmYqCiIg0U1EQEZFmKgoiItIszu8AB6pfv34uPz/f7xgiIt3K3Llztzrnstpr1+2KQn5+PoWFhX7HEBHpVsxsQ0fa6fCRiIg0U1EQEZFmKgoiItJMRUFERJqpKIiISDMVBRERaaaiICIizbrdPAUv7K5rYM7a7YzKSWdARpLfcTxRWVPP/I07Wbypgn6pCQzvn8ah2amkJoZ+BJqaHDUNjSTHBzEzn9OKiF96TFFYXVrFi4uKGZiZzMDMJHIzk1m3dRf/+ngTry4tYXddI8GAccLIbC6amsf04VkEA933w9E5x6JN5cyav5l3V29lRUklrV2OOz0pjtqGJmobmgDIzUzmzPEDOWfiQEYOSI9wahHxW48pCkuLK7jrtZX7PJ+RHM/ZE3I5aXR/5qzbzj8LN/La0hL69EogNzOZ7LREstMTGd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o3gIzm22ha47vWUVzdnjfv+hgb+YDPl1MMNXM/mtm8yx0HYCzw21uB4aFexe/Dbe9ObyfhWb28y78NkoPo6Igsex3wN3OuSOALwJ/CT+/HJjunJtIaFXU/2nxmiOBy5xzJ4QfTwRuAEYDQ4GjW9lPL2C2c2488Dbw9Rb7/114/+2usxNec+jzhGanA9QA5zrnJhG6tsed4aL0A2CNc26Cc+5mMzsJGA5MASYAk81senv7E2lNLC+IJ3IiMLrFKpbpZpYGZACPmtlwQqtTxrd4zWvOuZbr5n/onCsCMLP5hNa/eXev/dTx6WKEc4EvhO8fyadr9j8B/G8bOZNbvPdcQuvrQ2g9nf8Jf8A3EepB9G/l9SeFbx+HH6cSKhJvt7E/kTapKEgsCwBHOueqWz5pZvcCbzjnzg0fn3+zxeZde71HbYv7jbT+O1PvPh2ca6vN/lQ75yaYWQah4nIt8HtC13fIAiY75+rNbD2Q1MrrDfi1c+6BA9yvyD50+Ehi2auEro8AgJntWeY4A9gUvn+5h/ufTeiwFcAF7TV2zpUTuiTod80snlDO0nBB+BwwJNy0Ekhr8dJXgCvDa/xjZrlmlt1FX4P0MCoKEitSzKyoxe07hD5gC8KDr0sJLYUOoZUof21m7wFBDzPdAHzHzD4kdN3d8vZe4Jz7mNCqmxcQuqBOgZkVEuo1LA+32Qa8Fz6F9bfOuVcJHZ76wMwWAU/z2aIh0mE6JVXEI+Erz1U755yZXQBc6Jw7u73XifhJYwoi3pkM3Bc+Y2gnXXipVBGvqKcgIiLNNKYgIiLNVBRERKSZioKIiDRTURARkWYqCiIi0kxFQUREmv0/gl+UZBV1vpEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "learn.recorder.plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "Total time: 00:18 <p><table style='width:300px; margin-bottom:10px'>\n",
       "  <tr>\n",
       "    <th>epoch</th>\n",
       "    <th>train_loss</th>\n",
       "    <th>valid_loss</th>\n",
       "    <th>accuracy</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>1</th>\n",
       "    <th>0.215413</th>\n",
       "    <th>0.169024</th>\n",
       "    <th>0.945300</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>2</th>\n",
       "    <th>0.129223</th>\n",
       "    <th>0.080600</th>\n",
       "    <th>0.974500</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>3</th>\n",
       "    <th>0.071847</th>\n",
       "    <th>0.042908</th>\n",
       "    <th>0.986400</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "\n",
       "  </tr>\n",
       "</table>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "learn.fit_one_cycle(3, max_lr=0.1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Refactor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def conv2(ni,nf): return conv_layer(ni,nf,stride=2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "model = nn.Sequential(\n",
    "    conv2(1, 8),   # 14\n",
    "    conv2(8, 16),  # 7\n",
    "    conv2(16, 32), # 4\n",
    "    conv2(32, 16), # 2\n",
    "    conv2(16, 10), # 1\n",
    "    Flatten()      # remove (1,1) grid\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "learn = Learner(data, model, loss_func = nn.CrossEntropyLoss(), metrics=accuracy)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "Total time: 00:53 <p><table style='width:300px; margin-bottom:10px'>\n",
       "  <tr>\n",
       "    <th>epoch</th>\n",
       "    <th>train_loss</th>\n",
       "    <th>valid_loss</th>\n",
       "    <th>accuracy</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>1</th>\n",
       "    <th>0.222127</th>\n",
       "    <th>0.147457</th>\n",
       "    <th>0.955700</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>2</th>\n",
       "    <th>0.189791</th>\n",
       "    <th>0.305912</th>\n",
       "    <th>0.895600</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>3</th>\n",
       "    <th>0.167649</th>\n",
       "    <th>0.098644</th>\n",
       "    <th>0.969200</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>4</th>\n",
       "    <th>0.134699</th>\n",
       "    <th>0.110108</th>\n",
       "    <th>0.961800</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>5</th>\n",
       "    <th>0.119567</th>\n",
       "    <th>0.139970</th>\n",
       "    <th>0.955700</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>6</th>\n",
       "    <th>0.104864</th>\n",
       "    <th>0.070549</th>\n",
       "    <th>0.978500</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>7</th>\n",
       "    <th>0.082227</th>\n",
       "    <th>0.064342</th>\n",
       "    <th>0.979300</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>8</th>\n",
       "    <th>0.060774</th>\n",
       "    <th>0.055740</th>\n",
       "    <th>0.983600</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>9</th>\n",
       "    <th>0.054005</th>\n",
       "    <th>0.029653</th>\n",
       "    <th>0.990900</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>10</th>\n",
       "    <th>0.050926</th>\n",
       "    <th>0.028379</th>\n",
       "    <th>0.991100</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "\n",
       "  </tr>\n",
       "</table>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "learn.fit_one_cycle(10, max_lr=0.1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Resnet-ish"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "class ResBlock(nn.Module):\n",
    "    def __init__(self, nf):\n",
    "        super().__init__()\n",
    "        self.conv1 = conv_layer(nf,nf)\n",
    "        self.conv2 = conv_layer(nf,nf)\n",
    "        \n",
    "    def forward(self, x): return x + self.conv2(self.conv1(x))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def res_block(nf): return SequentialResBlock(conv_layer(nf,nf), conv_layer(nf,nf, bn_zero=True))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "model = nn.Sequential(\n",
    "    conv2(1, 8),\n",
    "    res_block(8),\n",
    "    conv2(8, 16),\n",
    "    res_block(16),\n",
    "    conv2(16, 32),\n",
    "    res_block(32),\n",
    "    conv2(32, 16),\n",
    "    res_block(16),\n",
    "    conv2(16, 10),\n",
    "    Flatten()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def conv_and_res(ni,nf): return nn.Sequential(conv2(ni, nf), res_block(nf))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "model = nn.Sequential(\n",
    "    conv_and_res(1, 8),\n",
    "    conv_and_res(8, 16),\n",
    "    conv_and_res(16, 32),\n",
    "    conv_and_res(32, 16),\n",
    "    conv2(16, 10),\n",
    "    Flatten()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "learn = Learner(data, model, loss_func = nn.CrossEntropyLoss(), metrics=accuracy)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "LR Finder is complete, type {learner_name}.recorder.plot() to see the graph.\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAIABJREFUeJzt3Xl4VOXdxvHvb5KQhSwsSdiChH0XkKggal1QlLrW6mtb9/a1Vmql1dpWq3WpW61WrV3ErbVS+7aituC+IaiIBsqasIPsJCFC9v15/5gxTWMggeTkTCb357rmYpZn5twJSe4558x5jjnnEBERAQj4HUBERMKHSkFEROqpFEREpJ5KQURE6qkURESknkpBRETqqRRERKSeSkFEROqpFEREpF603wEOVWpqqsvMzPQ7hohIh7JkyZIC51xac+M6XClkZmaSnZ3tdwwRkQ7FzD5ryThtPhIRkXoqBRERqadSEBGReioFERGpp1IQEZF6KgUREamnUhARkXod7jgFL9TVOf69bR8p8TEMTO1KVMD8jtTuCkureGP1buJjojhpeBrdErr4HUlEfNCpS2F/eTX/yN7Gs4s+Y2thGQBxMQGG90piSHoS3RNiSImPISUhhro6R1FFDcUV1VRU1zHhiG6cOCyN1MRYn7+KoM9Lq/hkSyGLNxWybk8xcTEBEmOjSYyLpndyHKP7pTC6bzLpSXEAlFfVkl9cyYod+3j53zuYvzafmrrg+bqjAsbEAd05fkgq1bV15BdXkl9cSWxMgJOGpXPyiHTSkmKpqqnjo40FvL5qN//eGizVnold6NG1C2awt6SKvSVVfF5WRdfYaFITY0lN7EK3hC4kxkaR0CWarrFRxMVEERsdRVxMgPiYKFISYugW34VuCTEA5BVVsruogvziSuJiAqQmxtIzsQtpSbHERkf59j0XiUTm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2YfAlEeZpoJ/MjMPiF43t39zT3BOfdvgrNuXkzwhDpZZpZNcK1hTWjMXuDD0EdYH3DOvUlw89QiM1sJvMB/l4ZIi+kjqSIeCZ15rtw558zsYuAbzrlzm3ueiJ+0T0HEOxOBx0KfGNpHG54qVcQrWlMQEZF62qcgIiL1VAoiIlJPpSAiIvVUCiIiUk+lICIi9VQKIiJS7/8Bzikl9cP6DzkAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "learn.lr_find(end_lr=100)\n",
    "learn.recorder.plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "Total time: 01:48 <p><table style='width:300px; margin-bottom:10px'>\n",
       "  <tr>\n",
       "    <th>epoch</th>\n",
       "    <th>train_loss</th>\n",
       "    <th>valid_loss</th>\n",
       "    <th>accuracy</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>1</th>\n",
       "    <th>0.179228</th>\n",
       "    <th>0.102691</th>\n",
       "    <th>0.971300</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>2</th>\n",
       "    <th>0.111155</th>\n",
       "    <th>0.089420</th>\n",
       "    <th>0.973400</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>3</th>\n",
       "    <th>0.099729</th>\n",
       "    <th>0.053458</th>\n",
       "    <th>0.982500</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>4</th>\n",
       "    <th>0.085445</th>\n",
       "    <th>0.160019</th>\n",
       "    <th>0.951700</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>5</th>\n",
       "    <th>0.074078</th>\n",
       "    <th>0.063749</th>\n",
       "    <th>0.980800</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>6</th>\n",
       "    <th>0.057730</th>\n",
       "    <th>0.090142</th>\n",
       "    <th>0.973800</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>7</th>\n",
       "    <th>0.054202</th>\n",
       "    <th>0.034091</th>\n",
       "    <th>0.989200</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>8</th>\n",
       "    <th>0.043408</th>\n",
       "    <th>0.042037</th>\n",
       "    <th>0.986000</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>9</th>\n",
       "    <th>0.033529</th>\n",
       "    <th>0.023126</th>\n",
       "    <th>0.992800</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>10</th>\n",
       "    <th>0.023253</th>\n",
       "    <th>0.017727</th>\n",
       "    <th>0.994400</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>11</th>\n",
       "    <th>0.019803</th>\n",
       "    <th>0.016165</th>\n",
       "    <th>0.994900</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "    <th>12</th>\n",
       "    <th>0.023228</th>\n",
       "    <th>0.015396</th>\n",
       "    <th>0.995400</th>\n",
       "  </tr>\n",
       "  <tr>\n",
       "\n",
       "  </tr>\n",
       "</table>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "learn.fit_one_cycle(12, max_lr=0.05)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## fin"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
